import 'dart:core';

import 'package:sui_shou_pai/record/record_entity/photo_record_entity.dart';

class LikedPhotoRecords {
  PhotoRecordEntity photoRecordEntity;
  String likeTime;

  LikedPhotoRecords(this.photoRecordEntity, this.likeTime);

  static LikedPhotoRecords fromMap(Map<String, dynamic> map) {
    String content = map['content'].toString();
    if (content.length > 10) {
      content = content.substring(0, 8) + "...";
    }
    return LikedPhotoRecords(
        PhotoRecordEntity(
            map['id'].toString(),
            map['createTime'].toString().substring(0, 10),
            map['employee_id'].toString(),
            map['publisherName'].toString(),
            map['responsibleName'].toString(),
            map['location'].toString(),
            map['type'].toString(),
            map['title'].toString(),
            content,
            map['image'].toString(),
            map['status'].toString(),
            map['responsible_id'].toString()),
        map['likeTime']);
  }
}
